export class Dict {
  id?: number;
  name = '';
  code = '';
  value = '';
  type = '';
  orderNum = 0;
  remark?: string;

  constructor(data?: Dict) {
    data && this.setProps(data);
  }

  setProps(data: Dict) {
    (Object.keys(this) as Array<keyof IDict>).forEach((key) => {
      // @ts-ignore
      this[key] = data[key]
    })
  }
}

export type IDict = Omit<Dict, 'setProps'>